package com.swlz.servlet.admin;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;

import com.swlz.dto.MallSearch;
import com.swlz.dto.UserSearch;
import com.swlz.service.MallProductService;
import com.swlz.service.MallTypeService;
import com.swlz.service.RoleService;
import com.swlz.service.UserService;
import com.swlz.service.impl.MallProductServiceImpl;
import com.swlz.service.impl.MallTypeServiceImpl;
import com.swlz.service.impl.RoleServiceImpl;
import com.swlz.service.impl.UserServiceImpl;
import com.swlz.servlet.HttpServletSupport;

@WebServlet("/admin/product-list.let")
public class ProductListServlet {
	private MallTypeService malltypeService =new MallTypeServiceImpl();
	private MallProductService mallProductService=new MallProductServiceImpl();
	

		private UserService userService = new UserServiceImpl();
		private RoleService roleService = new RoleServiceImpl();
		
		
		public String execute(HttpServletRequest request, MallSearch search) throws Exception {		
			request.setAttribute("malltype", malltypeService.list());
			request.setAttribute("search", search);
			request.setAttribute("p", mallProductService.page(search));
			return "/admin/product-list";
		}
	
	
}
